/*
 * File Name:    main.c
 *
 * Author:        Yoshinobu Date
 * Creation Date: Tuesday, August 09 2011, 11:50 
 * Last Modified: Tuesday, August 09 2011, 17:20
 * 
 * File Description:
 *
 */
#include <stdio.h>

//------
#include "checkNMEA.h"
#include "interpreter.h"

void main()
{
    printf("Input NMEA data-line and press enter.\n");
    char str[80];
    char str2[80];
    scanf("%s",&str);
    scanf("%s",&str2);
    
    printf("Checksum : %2X\n", checkSum(str));
    printf("Type Code : %d\n", typeCode2Num(str));
    if (validate(str)) {
        printf("Validation : OK!\n");
        printf("%d\n", dateTime(str));
        double a, b, c, d;
        a = latitude(str);
        b = longitude(str);
        c = latitude(str2);
        d = longitude(str2);
        printf("%f\n",distance(a,b,0,c,d,0));
        printf("%f\n",direction(a,b,c,d));
        
    }
    

}
